<?php
class Application_Model_Factory_Search_Index implements Application_Model_Factory_Search_IndexInterface
{
	/**
	 * Returns the index class based on the given $indexName.
	 *
	 * @author b.wenneker <b.wenneker@gmail.com>, 2010
	 * @throws LogicException
	 * @param string $indexName
	 * @return Zend_Db_Table_Abstract
	 */
	public function get ($indexName)
	{
		
		$className = 'Application_Model_Search_Index_' . ucfirst($indexName);
		if (! class_exists($className)) {
			throw new LogicException(
				__METHOD__ . ', Cannot find index class ' . $className
			);
		}
		
		$indexInstance = new $className();
		return $indexInstance;
	}
}